﻿#pragma once
#include <string>
#include "Disasm.h"

// CShellcodeDlg 对话框

class CShellcodeDlg : public CDialogEx
{
	DECLARE_DYNAMIC(CShellcodeDlg)

public:
	CShellcodeDlg(CWnd* pParent = nullptr);   // 标准构造函数
	virtual ~CShellcodeDlg();

// 对话框数据
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_SHELLCODE_DIALOG };
#endif

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持

	DECLARE_MESSAGE_MAP()

public:
    virtual BOOL PreTranslateMessage(MSG* pMsg);
    virtual BOOL OnInitDialog();

protected:
    CString m_strShellCode;
    CEdit m_EditDisasm;
    CEdit m_EditInputCode;
    PVOID m_lpCodeAddress;

protected:
    void DisasmBuff(ZydisDecoder* decoder, ZyanU8* data, ZyanUSize length);

public:
    afx_msg void OnBnClickedBtnConfirm();
    afx_msg void OnClose();
    afx_msg void OnEnChangeEditShellcode();
    afx_msg LRESULT OnRecvCodeInjectAddress(WPARAM wParam, LPARAM lParam);
};
